package com.example.demo.demos.web;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.common.util.FuYuUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FunctionExample {

    private static final Logger logger = LoggerFactory.getLogger(FunctionExample.class);

    public static void main(String[] args) {

        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
        wrapper.select(User::getName, User::getAge, User::getId);

        if (true) {
            System.out.println("this is true");
        } else {
            throw new RuntimeException();
        }

        FuYuUtils.isTrue(true).throwMessage("this is true");
        FuYuUtils.isTrue(false).throwMessage("this is false");


        FuYuUtils.isTrueOrFalse(true).trueOrFalseHandler(() -> {
            System.out.println("this is true");
        }, () -> {
            System.out.println("this is false");
        });


        FuYuUtils.isPresent(null).presentOrElseHandler(System.out::println, () ->{
            System.out.println("空字符串");
        });
    }
}
